def longest_peak(numbers):
  result = 0

  # 找波峰
  i = 1
  while i < len(numbers) - 1:
    is_peak = numbers[i - 1] < numbers[i] and numbers[i + 1] < numbers[i]

    if not is_peak:
      i += 1
      continue

    # 找到了一个波峰位置 i
    # 就要分别从 i 的位置开始先向左一直延伸，延伸到不能延伸为止 l
    l = i - 2
    while l >= 0 and numbers[l] < numbers[l + 1]:
      l -= 1

    #从 i 的位置再向右
    r = i + 2
    while r <= len(numbers) - 1 and numbers[r] < numbers[r - 1]:
      r += 1

    curr_length = r - l + 1 - 2
    result = max(result, curr_length)
    i = r

  return result